package com.axter.libs.base.adapter;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

/**
 * 适配器用简易工具类
 * Created by zhaobo on 2016/8/24.
 */
public class AdapterUtils {
    public static View getView(LayoutInflater inflater, ViewGroup parent, Object obj) {
        if (obj == null) {
            return null;
        }
        if (obj instanceof Integer) {
            return inflater.inflate((Integer) obj, parent, false);
        } else if (obj instanceof View) {
            return (View) obj;
        } else {
            return null;
        }
    }
}
